/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ereconquista.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "paquetes_empresas", catalog = "ereconquista", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PaqueteEmpresa.findAll", query = "SELECT p FROM PaqueteEmpresa p"),
    @NamedQuery(name = "PaqueteEmpresa.findById", query = "SELECT p FROM PaqueteEmpresa p WHERE p.id = :id"),
    @NamedQuery(name = "PaqueteEmpresa.findByFechaInicio", query = "SELECT p FROM PaqueteEmpresa p WHERE p.fechaInicio = :fechaInicio"),
    @NamedQuery(name = "PaqueteEmpresa.findByFechaFin", query = "SELECT p FROM PaqueteEmpresa p WHERE p.fechaFin = :fechaFin"),
    @NamedQuery(name = "PaqueteEmpresa.findByFkEmpresa", query = "SELECT p FROM PaqueteEmpresa p WHERE p.fkEmpresa = :fkEmpresa"),
    @NamedQuery(name = "PaqueteEmpresa.findByFkTarifa", query = "SELECT p FROM PaqueteEmpresa p WHERE p.fkTarifa = :fkTarifa"),
    @NamedQuery(name = "PaqueteEmpresa.findByEstado", query = "SELECT p FROM PaqueteEmpresa p WHERE p.estado = :estado")})
public class PaqueteEmpresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Long id;
    @Column(name = "fecha_inicio")
    @Temporal(TemporalType.DATE)
    private Date fechaInicio;
    @Column(name = "fecha_fin")
    @Temporal(TemporalType.DATE)
    private Date fechaFin;
    @Basic(optional = false)
    @Column(name = "fk_empresa", nullable = false)
    private long fkEmpresa;
    @Basic(optional = false)
    @Column(name = "fk_tarifa", nullable = false)
    private long fkTarifa;
    @Basic(optional = false)
    @Column(nullable = false, length = 1)
    private String estado;

    public PaqueteEmpresa() {
    }

    public PaqueteEmpresa(Long id) {
        this.id = id;
    }

    public PaqueteEmpresa(Long id, long fkEmpresa, long fkTarifa, String estado) {
        this.id = id;
        this.fkEmpresa = fkEmpresa;
        this.fkTarifa = fkTarifa;
        this.estado = estado;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getFechaInicio() {
        return fechaInicio;
    }

    public void setFechaInicio(Date fechaInicio) {
        this.fechaInicio = fechaInicio;
    }

    public Date getFechaFin() {
        return fechaFin;
    }

    public void setFechaFin(Date fechaFin) {
        this.fechaFin = fechaFin;
    }

    public long getFkEmpresa() {
        return fkEmpresa;
    }

    public void setFkEmpresa(long fkEmpresa) {
        this.fkEmpresa = fkEmpresa;
    }

    public long getFkTarifa() {
        return fkTarifa;
    }

    public void setFkTarifa(long fkTarifa) {
        this.fkTarifa = fkTarifa;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaqueteEmpresa)) {
            return false;
        }
        PaqueteEmpresa other = (PaqueteEmpresa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ereconquista.modelo.PaqueteEmpresa[ id=" + id + " ]";
    }
    
}
